home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 17
/
Hot Mix 17.iso
/
HM17_SGI
/
research
/
examples
/
doc
/
sigprc04
< prev
next >
Wrap
Text File
|
1997-07-08
|
916b
|
30 lines
; This batch file creates a plot of the magnitude and phase
; of the simulated signal used in the example from Chapter 13,
; "Signal Processing", of _Using IDL_.
@sigprc01.bat ; compute time data sequence u
V = FFT(U) ; compute spectrum v
F = FINDGEN(N/2+1) / (N*delt) ; f = [0.0, 1.0/(N*delt), ... , 1.0/(2.0*delt)]
mag = ABS(V(0:N/2)); magnitude of first half of v
phi = ATAN(V(0:N/2)) ; phase of first half of v
; log plots of magnitude in dB and phase in degrees
!P.MULTI = [0, 1, 2] ; set up for two plots in window
PLOT, F, 20*ALOG10(mag), YTITLE='Magnitude in dB', $
XTITLE='Frequency in cycles / second', /XLOG, $
XRANGE=[1.0,1.0/(2.0*delt)], XSTYLE=1, TITLE='Spectrum of u(k)'
PLOT, F, phi/!DTOR, YTITLE='Phase in degrees', $
YRANGE=[-180,180], YSTYLE=1, YTICKS=4, YMINOR=3, $
XTITLE='Frequency in cycles / second', /XLOG, $
XRANGE=[1.0,1.0/(2.0*delt)], XSTYLE=1
!P.MULTI = 0